repo_name stringlengths 6 115 | branch_name stringclasses 217
values | path stringlengths 2 728 | content stringlengths 1 5.16M |
|---|---|---|---|
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | /Dictionary with function.py | def returnSum(dict):
sum=0
for i in dict:
sum=sum+dict[i]
return sum
dict={'Rick':85,'Amit':42,'George':53,'Tanya':60,'Linda':35}
print 'sum:', returnSum(dict)
|
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | /README.md | # Python-Code-Assessment
Comprises of 4 programs in Python
|
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | /FizzBuzz.py | n=int(input("enter the numbers u want to print:"))
for i in range(1,n+1):
if(i%3==0):
print ('Fizz')
continue
elif(i%5==0):
print ('Buzz')
continue
print i
|
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | /Cricket Match Player Score.py | def switch(on_strike):
players = {1,2}
return list(players.difference(set([on_strike])))[0]
def get_player(previous_score, previous_player, previous_bowl_number):
if previous_score%2 == 0 and (previous_bowl_number%6 !=0 or previous_bowl_number ==0):
player = previous_player
elif p... |
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | /repeat.py | arr=[1,2,3,5,8,4,7,9,1,4,12,5,6,5,2,1,0,8,1]
a = [None] * len(arr);
visited = 0;
for i in range(0, len(arr)):
count = 1;
for j in range(i+1, len(arr)):
if(arr[i] == arr[j]):
count = count + 1;
a[j] = visited;
if(a[i] != visited):
a[i]... |
qtngr/HateSpeechClassifier | refs/heads/master | /classifiers.py | import warnings
import os
import json
import pandas as pd
import numpy as np
import tensorflow as tf
from joblib import dump, load
from pathlib import Path
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score, classification_repo... |
qtngr/HateSpeechClassifier | refs/heads/master | /BERT_classifiers.py | ## importing packages
import gc
import os
import random
import transformers
import warnings
import json
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras.backend as K
from pathlib import Path
from sklearn.metrics import accuracy_score, classification_report
from sklearn.model_sele... |
marcom97/Job_Server | refs/heads/master | /README.md | # Job_Server
A server that receives commands from clients for running and monitoring jobs
This is a project that I made for a systems programming course. The server can take several commands (ending with a CRLF) for managing multiple jobs and the clients can choose to monitor these jobs to receive all the output from ... |
marcom97/Job_Server | refs/heads/master | /jobserver.c | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
#include "socket.h"
#include "jobprotocol.h"
#define QUEUE_LENGTH 5
#define MAX_CLIENTS 20
#i... |
marcom97/Job_Server | refs/heads/master | /jobprotocol.c | #include <unistd.h>
#include <string.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include "jobprotocol.h"
/* Example: Something like the function below might be useful
// Find and return the location of the first newline character in a string
// First argument is a string, second argument is the le... |
jgerulskis/SnapShop | refs/heads/master | /app/src/main/java/com/example/snapshop/api/CloudSightAPI.kt | package com.example.snapshop.api
import retrofit2.Call
import retrofit2.http.*
interface CloudSightAPI {
@Headers("Authorization: CloudSight EAC4Y9ZLBFaGzaiM2IqPBg", "content-type: application/json")
@POST("images")
fun identify(@Body body: HashMap<String, Any>): Call<ImagePostResponse>
} |
jgerulskis/SnapShop | refs/heads/master | /app/src/main/java/com/example/snapshop/Storage.kt | package com.example.snapshop
import android.content.Context
import android.content.SharedPreferences
import com.example.snapshop.api.ImagePostResponse
import com.google.gson.Gson
class Storage(context: Context) {
private val name = "past_results"
private val resultsKey = "results"
private var sharedPrefer... |
jgerulskis/SnapShop | refs/heads/master | /app/src/main/java/com/example/snapshop/MainActivity.kt | package com.example.snapshop
import android.content.ActivityNotFoundException
import android.content.Intent
import android.graphics.Bitmap
import android.os.Bundle
import android.provider.MediaStore
import android.util.Base64
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.lifec... |
jgerulskis/SnapShop | refs/heads/master | /app/src/main/java/com/example/snapshop/api/ImageIdentifier.kt | package com.example.snapshop.api
import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import retrofit2.Retrofit
import retr... |
jgerulskis/SnapShop | refs/heads/master | /settings.gradle | include ':app'
rootProject.name = "SnapShop" |
jgerulskis/SnapShop | refs/heads/master | /app/src/main/java/com/example/snapshop/api/ImagePostResponse.kt | package com.example.snapshop.api
import com.google.gson.annotations.SerializedName
data class ImagePostResponse(
@SerializedName("name") var name: String = "",
@SerializedName("url") var url: String = "",
@SerializedName("token") var token: String = ""
) {
} |
renjusherston/fabric-boilerplate | refs/heads/master | /api/v1/user/user.controller.js | 'use strict';
const User = require('./user.model');
const BlockchainService = require('../../../blockchainServices/blockchainSrvc.js');
|
renjusherston/fabric-boilerplate | refs/heads/master | /blockchain/chaincodeconfig.js | var credentials = require('./deployBluemix/credentials.json').credentials;
var app_users = require('../testdata/testData.json').users;
var environments = {
production : {
network:{
peers: credentials.peers,
ca: credentials.ca,
users: credentials.users,
app_u... |
renjusherston/fabric-boilerplate | refs/heads/master | /blockchainServices/blockchainSrvc.js | const blockchain = require('../blockchain/blockchain');
exports.query = function(functionName, args, enrollmentId){
return new Promise(function(resolve, reject){
blockchain.query(functionName, args, enrollmentId, function(err, results){
if(err) {reject(err)}
else {resolve(results)}... |
renjusherston/fabric-boilerplate | refs/heads/master | /blockchain/deployBluemix/deployAndRegister.js | /*
Run the script with `GOPATH="$(pwd)/../.." node deployAndRegister.js`
For more logs run: `GRPC_TRACE=all DEBUG=hfc GOPATH="$(pwd)/../.." node deployAndRegister.js`
*/
var hfc = require('hfc');
var fs = require('fs-extra');
var https = require('https');
var logger = require('../../utils/logger');
var crede... |
renjusherston/fabric-boilerplate | refs/heads/master | /blockchain/blockchain.js | 'use strict';
var hfc = require('hfc');
var fs = require('fs-extra');
var crypto = require('crypto');
var logger = require('../utils/logger');
var config = require('./chaincodeconfig');
var testData = require('../testdata/testData.js');
var chain, chaincodeID, onBluemix;
var chaincodePath = process.env.GOPATH + "/src... |
TheDinner22/lightning-sim | refs/heads/main | /lib/board.py | # represent the "board" in code
# dependencies
import random
class Board:
def __init__(self, width=10):
self.width = width
self.height = width * 2
self.WALL_CHANCE = .25
self.FLOOR_CHANCE = .15
# create the grid
self.create_random_grid()
def create_random_gri... |
TheDinner22/lightning-sim | refs/heads/main | /lib/window.py | # use pygame to show the board on a window
# dependencies
import pygame, random
class Window:
def __init__(self, board):
# init py game
pygame.init()
# width height
self.WIDTH = 600
self.HEIGHT = 600
# diffenet display modes
self.display_one = False
... |
TheDinner22/lightning-sim | refs/heads/main | /README.md | # What?
I'm trying to replicate what I saw here: https://www.youtube.com/watch?v=akZ8JJ4gGLs&t=252s
I will use pygame to make a window.
# dependencies
-pygame |
TheDinner22/lightning-sim | refs/heads/main | /main.py | # this could and will be better i just needed to make it here as a
# proof of concept but it will be online and better later
import os, sys
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # adds project dir to places it looks for the modules
sys.path.append(BASE_PATH)
from lib.board import B... |
snehG0205/Twitter_Mining | refs/heads/master | /tweepy_tester.py | import tweepy
import csv
import pandas as pd
from textblob import TextBlob
import matplotlib.pyplot as plt
####input your credentials here
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9'
access_token = '975924102190874624-uk5zGlYRwItkj7pZO2m89NefRm5DFLg... |
snehG0205/Twitter_Mining | refs/heads/master | /twitter1.py | import tweepy
import csv
import pandas as pd
# keys and tokens from the Twitter Dev Console
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9'
access_token = '975924102190874624-uk5zGlYRwItkj7pZO2m89NefRm5DFLg'
access_token_secret = 'ChvmTjG8hl61xUrXkk3Ad... |
snehG0205/Twitter_Mining | refs/heads/master | /tester.py | import csv
csvFile = open('res.csv', 'w+') |
snehG0205/Twitter_Mining | refs/heads/master | /Twitter-Flask/file.php | <?php
$output = exec("python hello.py");
echo $output;
?> |
snehG0205/Twitter_Mining | refs/heads/master | /Twitter-Flask/untitled.py | from test import mining
tag = "#WednesdayWisdom"
limit = "10"
sen_list = mining(tag,int(limit))
print(sen_list) |
snehG0205/Twitter_Mining | refs/heads/master | /Twitter-Flask/app.py | from flask import Flask, render_template, request
from test import mining
app = Flask(__name__)
@app.route('/')
def index():
return render_template('hello.html')
@app.route('/', methods=['GET', 'POST'])
def submit():
if request.method == 'POST':
print (request.form) # debug line, see data printed below
tag = r... |
snehG0205/Twitter_Mining | refs/heads/master | /Twitter-Flask/hello.py | #!/usr/bin/env python
print ("some output")
return "hello" |
snehG0205/Twitter_Mining | refs/heads/master | /piPlotter.py | import matplotlib.pyplot as plt
# Data to plot
labels = 'Neutral', 'Positive', 'Negative'
sizes = [20, 40, 40]
colors = ['lightskyblue','yellowgreen', 'lightcoral']
explode = (0.0, 0, 0) # explode 1st slice
# Plot
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True,... |
DavidMolinari/Ports-form | refs/heads/master | /Frm_Gestion_Navire/Port.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Frm_Gestion_Navire
{
/// <summary>
/// Class Port qui va contenir une collection d'objets de type ToutNavire
/// </summary>
public class Port
{
priva... |
DavidMolinari/Ports-form | refs/heads/master | /Frm_Gestion_Navire/ToutNavire.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Frm_Gestion_Navire
{
/// <summary>
/// Classe Abstraite ToutNavire
/// </summary>
public abstract class ToutNavire
{
private int _NoLloyds;
pr... |
DavidMolinari/Ports-form | refs/heads/master | /README.md | # Ports-form
c# Learning
|
DavidMolinari/Ports-form | refs/heads/master | /Frm_Gestion_Navire/NavirePassager.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Frm_Gestion_Navire
{
/// <summary>
/// Class NavirePassager qui hérite de ToutNavire
/// </summary>
public class NavirePassager : ToutNavire
{
private ... |
DavidMolinari/Ports-form | refs/heads/master | /Frm_Gestion_Navire/Frm_Gestion_Navire.cs | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Frm_Gestion_Navire
{
public partial class Frm_Gestion_Navire : Form
{
... |
DavidMolinari/Ports-form | refs/heads/master | /Frm_Gestion_Navire/NavireFret.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Frm_Gestion_Navire
{
/// <summary>
/// Class NavireFret qui hérite de la classe ToutNavire.
/// </summary>
public class NavireFret : ToutNavire
{
priva... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/componentes/Header.js | import React from 'react'
import '../estilos/header.css'
import {Navbar,Icon,NavItem} from 'react-materialize'
function Header() {
// camibiar color de navbar
window.onscroll = function() {
var y = window.scrollY;
if(y>71)
{
document.getElementById("nave").className = "navbarEstilos";
}e... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/componentes/Tarjeta.js | import React from 'react'
import {Row,Col,Card,Icon,CardTitle} from 'react-materialize'
function Tarjeta()
{
return (
<Col
m={6}
s={12}
l={4}
>
<Card
actions={[
<a key="1" href="#">This is a Link</a>
]}
closeIcon={<Icon>close</Icon>}
header={<CardTitle image={r... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/componentes/Piedepagina.js | import React from 'react'
import {Footer} from 'react-materialize'
import '../estilos/piepagina.css'
function Piedepagina(params) {
return(
<Footer
className="example"
links={
<ul>
<li><a className="grey-text text-lighten-3" ><h5>Contacto</h5> </a></li>
<li><a className="grey-text text... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/componentes/ParrallaxImg.js | import React from 'react'
import {Parallax} from 'react-materialize'
import imgEscritorio from '../imagenes/imagenes/escritorio.jpg'
import imgFotoPerfil from '../imagenes/imagenes/fotoperfil.jpg'
import pdf from '../curriculum/test.pdf'
import Typical from 'react-typical';
function ParallaxImg() {
return(
<di... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/componentes/Barralateral.js | import React, { useEffect } from 'react'
import {SideNav,Button,Icon,SideNavItem}from 'react-materialize'
import M from "materialize-css/dist/js/materialize.min.js";
import '../estilos/barralateral.css'
import imgFotoPerfil from '../imagenes/imagenes/fotoperfil.jpg'
function Barralateral() {
useEffect(()=>
{
... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/App.js | import React,{useEffect} from 'react';
import Header from './componentes/Header'
import Barralateral from './componentes/Barralateral'
import Piedepagina from './componentes/Piedepagina'
import ParalaxImg from './componentes/ParrallaxImg'
import M from 'materialize-css/dist/js/materialize.min.js'
import 'materialize-c... |
FernandoMichea90/webcurriculum | refs/heads/master | /src/componentes/ImagenIcono.js | import React from 'react'
import js from '../imagenes/imagenes/iconos/js.png'
import '../estilos/imgicon.css'
//imagenes
import css from '../imagenes/imagenes/iconos/css.png'
import java from '../imagenes/imagenes/iconos/java.jpg'
import materialize from '../imagenes/imagenes/iconos/materialize.png'
import mysql from... |
dspinellis/PPS-monitor | refs/heads/master | /ppsmon.py | #!/usr/bin/env python3
#
# Copyright 2018-2022 Diomidis Spinellis
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
dspinellis/PPS-monitor | refs/heads/master | /Makefile | install:
install ppsmon.py /usr/lib/netdata/plugins.d/ppsmon.plugin
|
dspinellis/PPS-monitor | refs/heads/master | /README.md | # PPS-monitor
The PPS monitor is a Python script that will monitor a PPS
(Punkt-zu-Punkt Schnittstelle) or H-Bus heating automation network link
using a Raspberry Pi.
The script can output individual messages, or it can produce a CSV log
of all 11 monitored values.
It can also act as a [Netdata](https://github.com/fir... |
Yuliashka/Snake-Game | refs/heads/main | /food.py |
from turtle import Turtle
import random
# we want this Food class to inherit from the Turtle class, so it will have all the capapibilities from
# the turtle class, but also some specific things that we want
class Food(Turtle):
# creating initializer for this class
def __init__(self):
# we... |
Yuliashka/Snake-Game | refs/heads/main | /snake.py |
from turtle import Turtle
STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)]
MOVE_DISTANCE = 20
UP = 90
DOWN = 270
RIGHT = 0
LEFT = 180
class Snake:
# The code here is going to determine what should happen when we initialize a new snake object
def __init__(self):
# below we create a new... |
Yuliashka/Snake-Game | refs/heads/main | /main.py |
from turtle import Screen
import time
from snake import Snake
from food import Food
from scoreboard import Score
# SETTING UP THE SCREEN:
screen = Screen()
screen.setup(width=600, height=600)
screen.bgcolor("black")
screen.title("My Snake Game")
# to turn off the screen tracer
screen.tracer(0)
# CREAT... |
Yuliashka/Snake-Game | refs/heads/main | /scoreboard.py |
from turtle import Turtle
ALIGMENT = "center"
FONT = ("Arial", 18, "normal")
class Score(Turtle):
def __init__(self):
super().__init__()
self.score = 0
self.color("white")
self.penup()
self.goto(0, 270)
self.write(f"Current score: {self.score}", align... |
ErnestojuarezO/ErnestojuarezO | refs/heads/main | /validar-informacion.php | <?php
include ("./conexion_BD.php");
$no = $_POST['no'];
$marca = $_POST['marca'];
$modelo = $_POST['modelo'];
$color = $_POST['color'];
$precio = $_POST['precio'];
$opcion = $_POST['opcion'];
$alcance = $_POST['alcance'];
$linea = $_POST['linea'];
$voltaje = $_POST['voltaje'];
$canales = $_POS... |
ErnestojuarezO/ErnestojuarezO | refs/heads/main | /formulario.sql | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 26-10-2021 a las 04:20:19
-- Versión del servidor: 10.4.21-MariaDB
-- Versión de PHP: 7.4.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
ErnestojuarezO/ErnestojuarezO | refs/heads/main | /conexion_BD.php | <?php
$host ='localhost';
$bd ='Formulario';
$usuario ='logincuser';
$password ='loginc';
$conexion = mysqli_connect($host,$usuario,$password ,$bd);
if(!$conexion){
die('error de conexion:'.mysqli_connect_error());
exit();
}//end if
else{
mysqli_query($conexion, "SET NAMES 'utf8'");
}//end else
?> |
nopple/ctf | refs/heads/master | /README.md | ctf
===
Various CTF writeups when I feel like it
|
nopple/ctf | refs/heads/master | /shitsco/README.md | #Information
This was an unintended use-after-free vulnerability in the variable processing commands (set/show). Exploitation is straight-forward:
* Trigger the invalid state by adding and removing variables
* Cause a 16-byte allocation with controlled data to fill the freed structure
* make a fake variable structur... |
nopple/ctf | refs/heads/master | /dosfun4u/pwn.py | #!/usr/bin/env python
import socket, subprocess, sys
from struct import pack, unpack
global scenes
global officers
scenes = {}
officers = {}
remote = len(sys.argv) > 1
PORT = 8888
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if remote:
HOST = "dosfun4u_5d712652e1d06a362f7fc6d12d66755b.2014.shallweplayaga... |
nopple/ctf | refs/heads/master | /dosfun4u/README.md | #Vulnerability
Due to an uninitialized variable in the memory allocation function, if there is only one element in the free-list, that element will be returned but not removed from the list. This means that the chunk can be returned for as many memory allocations as you want, leading to type confusion and profit.
#Rel... |
nopple/ctf | refs/heads/master | /shitsco/pwn.py | #!/usr/bin/env python
import socket
from struct import pack, unpack
DEBUG = False
server = "shitsco_c8b1aa31679e945ee64bde1bdb19d035.2014.shallweplayaga.me"
server = "127.0.0.1"
port = 31337
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((server, port))
s.settimeout(30)
def recv_until(s, pattern):
... |
ALEXPY95/app-peliculas | refs/heads/main | /src/components/Spinner.js | import {FaSpinner} from 'react-icons/fa'
import Styles from './Spinner.module.css'
function Spinner() {
return (
<div className={Styles.container}>
<FaSpinner className={Styles.spinning} size="50"/>
</div>
)
}
export default Spinner
|
zchucka/CPSC224_Group1 | refs/heads/master | /scorer.java | public class scorer {
private int roundScore = 0;
hand playerHand;
private int[] frequencyArray = new int[6];
/*
* creates an object that contains a hand object of dice that need to be score and a round score
* this object is used in place of a score card to calculate the round scores
* ... |
zchucka/CPSC224_Group1 | refs/heads/master | /dice.java | import java.util.*;
public class dice implements Cloneable {
/*
* creates an object called dice that contains a roll number that is an integer
* and has a function that reassigns the dice a random value from one to six
* and a function that returns the value.
* dice is also cloneable
*/
int rollNu... |
zchucka/CPSC224_Group1 | refs/heads/master | /checkIfValid.java | public class checkIfValid
{
public static void main(String args[])
{
hand myHand = new hand(6, 6, 3);
myHand.roll("nnnnnn");
myHand.displayRoll();
if(checkValidity(myHand))
{
System.out.println("Valid Hand");
}
else
{
Syste... |
zchucka/CPSC224_Group1 | refs/heads/master | /Farkle.java | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout;
/*
* Created by JFormDesigner on Sat Apr 21 14:15:42 PDT 2018
*/
/**
* @author unknown
*/
public class Farkle extends JPanel {
public Farkle() {
initComponents();
}
private void button2ActionPer... |
zchucka/CPSC224_Group1 | refs/heads/master | /hand.java | public class hand {
dice[] cupOfDice;
int numOfRolls = 0;
int numOfDice;
int numOfSides = 6;
/*
* creates the hand which contains an array of dice
* also assigns number of dice, sides, and the max number of rolls
* @param number of dice
* @returns an object containing an array of dice and two in... |
drhodes/beta-asm | refs/heads/master | /Makefile |
build: ## build
echo stack build
test: FORCE ## test
stack test --ghc-options -fprof-auto --test-arguments +RTS -N -RTS \
'--hide-successes'
stack install
clean: FORCE ## clean all the things
sh clean.sh
work: ## open all files in editor
emacs -nw *.cabal Makefile \
battle-plan.org src/Uasm/*.hs \
src/Beta/... |
drhodes/beta-asm | refs/heads/master | /clean.sh | stack clean
rm -f $(find ./ | grep \~)
|
avh4/mercury | refs/heads/master | /examples/shared-state.js | var mercury = require("../index.js")
var h = mercury.h
var events = mercury.input(["change"])
var textValue = mercury.value("")
events.change(function (data) {
textValue.set(data.text)
})
function inputBox(value, sink) {
return h("input.input", {
value: value,
name: "text",
type: "tex... |
avh4/mercury | refs/heads/master | /test/count.js | var test = require('tape');
var path = require('path');
var event = require('synthetic-dom-events');
var document = require('min-document');
var raf = require('raf');
var loadExample = require('./lib/load-example.js')
var embedComponent = require('./lib/embed-component.js')
var src = path.join(__dirname, '../examples... |
b-developer/ms_basics | refs/heads/master | /README.md | # ms_basics
basics of microservices
|
b-developer/ms_basics | refs/heads/master | /rest-micro-services-basics/src/test/java/com/study/restmicroservicesbasics/RestMicroServicesBasicsApplicationTests.java | package com.study.restmicroservicesbasics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RestMicroServicesBasicsApplicationTests {
@Test
void contextLoads() {
}
}
|
b-developer/ms_basics | refs/heads/master | /rest-micro-services-basics/src/main/resources/application.properties | spring.application.name=rest-microservices
|
anurag3301/Tanmay-Bhat-Auto-Video-Liker | refs/heads/main | /main.py | from selenium import webdriver
from selenium.common.exceptions import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
from getpass import getpass
import tkinter as tk
fro... |
jimrhoskins/dotconfig | refs/heads/master | /powerline/lib/powerext/segments.py | import os
def vcs_status():
from powerline.lib.vcs import guess
repo = guess(os.path.abspath(os.getcwd()))
if repo and repo.status():
return "X"
else:
return None
|
jimrhoskins/dotconfig | refs/heads/master | /powerline/bindings/bash/powerline.sh | _powerline_tmux_setenv() {
if [[ -n "$TMUX" ]]; then
tmux setenv TMUX_"$1"_$(tmux display -p "#D" | tr -d %) "$2"
fi
}
_powerline_tmux_set_pwd() {
_powerline_tmux_setenv PWD "$PWD"
}
_powerline_tmux_set_columns() {
_powerline_tmux_setenv COLUMNS "$COLUMNS"
}
trap "_powerline_tmux_set_columns" SIGWINCH
kill -SI... |
jimrhoskins/dotconfig | refs/heads/master | /zshrc | # Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="robbyrussell"
# Disable autosetting terminal title.
DISABLE_AUTO_TITLE="true"
XDG_CONFIG_HOME=~/.config/
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_... |
jimrhoskins/dotconfig | refs/heads/master | /README.md | Config for my zsh, tmux, and powerline
git clone git@github.com:jimrhoskins/dotconfig.git $HOME/.config
mv $HOME/.tmux.conf $HOME/.tmux.conf.old
mv $HOME/.zshrc $HOME/.zshrc.old
ln -s $HOME/.config/tmux.conf $HOME/.tmux.conf
ln -s $HOME/.config/zshrc $HOME/.zshrc
|
kodemechanic/KodeService | refs/heads/master | /config/db/mongoose.js | // Connect to and export connection of Mongoose
var mongoose = require('mongoose');
var configDB = {
'url' : 'mongodb://localhost:27017/rest'
};
var db = mongoose.connect(configDB.url);
module.exports = db.connection; |
kodemechanic/KodeService | refs/heads/master | /routes/dashboard.js | var express = require('express');
var router = express.Router();
var async = require('async');
var mongo = require('../config/db/mongodb.js');
var mongoose = require('../config/db/mongoose.js');
var User = require('../config/models/usermodel');
var passport = require('../config/passport.js');
// ********** Dash... |
kodemechanic/KodeService | refs/heads/master | /public/javascripts/login.js | // get Modals and set click to close modal.
var loginmodal = document.getElementById('id01');
var signupmodal = document.getElementById('id02');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == loginmodal) {
loginmodal.style.display = "n... |
kodemechanic/KodeService | refs/heads/master | /config/db/mongodb.js | var mongodb = require('mongodb');
module.exports.init = function (callback) {
var server = new mongodb.Server("localhost", 27017, {});
new mongodb.Db('rest', server, {w:1}).open(function (err, client) {
// export the client as a shortcut. Collection exported as example for later use...
module.exports.clie... |
kodemechanic/KodeService | refs/heads/master | /config/models/usermodel.js | /*
* KodeAPI User Model
*/
// load required modules
var mongoose = require('mongoose');
var bcrypt = require('bcrypt-nodejs');
var UserInfoSchema = new mongoose.Schema({
firstName: {type: String},
lastName: {type: String},
address: {type: String},
city: {type: String},
state: {type: String},
zip: {ty... |
kodemechanic/KodeService | refs/heads/master | /routes/authAPI.js | var express = require('express');
var router = express.Router();
var async = require('async');
var mongo = require('../config/db/mongodb.js');
var mongoose = require('../config/db/mongoose.js');
var User = require('../config/models/usermodel');
var passport = require('../config/passport.js');
router.get('/', function(... |
kodemechanic/KodeService | refs/heads/master | /routes/service.js | /* Service API */
var express = require('express');
var router = express.Router();
var mongo = require('../config/db/mongodb.js');
router.get('/', function(req, res){
mongo.client.collections(function(err,data){
if(err) { res.status(500).send({error: err}); }
else {
//TODO: remove "." as a valid ... |
kodemechanic/KodeService | refs/heads/master | /app.js | var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');
var passport = require('passport');
var jwt = require('jw... |
ycba-cia/cia-solr | refs/heads/master | /lib/scripts/delete_list_of_solr_ids.rb | require 'yaml'
require 'rsolr'
#deprecated: get solr from yml file
#y = YAML.load_file("../../config/solr.yml")
#solr = RSolr.connect :url => y["url"]
#solr2 = RSolr.connect :url => y["url2"]
#tunnelling
#ssh -i "ycba-test.pem" -L 8983:10.5.96.78:8983 10.5.96.187 -l ec2-user
url = "http://10.5.96.187:8983/solr/ycba-... |
ycba-cia/cia-solr | refs/heads/master | /app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
y = YAML.load_file("#{Rails.root.to_s}/config/solr.yml")
user1 = y["user1"]
password1 = y["password1"]
http_basic_authenticate_with name: user1, password: password1
end
|
ycba-cia/cia-solr | refs/heads/master | /app/controllers/home_controller.rb | class HomeController < ApplicationController
before_action :solr_connect, only: [:confirm,:submit]
def solr_connect
y = YAML.load_file("#{Rails.root.to_s}/config/solr.yml")
@solrs = Array.new
@solr = RSolr.connect :url => y["url"]
@solr2 = RSolr.connect :url => y["url2"]
@solrs.push(@solr)
... |
ycba-cia/cia-solr | refs/heads/master | /scripts/blacklight_clean/clean_blacklight.rb | require 'rsolr'
solr_url1 = "http://10.5.96.187:8983/solr/ycba-collections_dev1"
solr_url2 = "https://user:6bELqBB8UTfl@ciaindex.britishart.yale.edu/solr/ycba_blacklight"
solr_conn1 = RSolr.connect :url => solr_url1
solr_conn2 = RSolr.connect :url => solr_url2
#uncomment to delete
#mode = "delete"
response = solr_co... |
ycba-cia/cia-solr | refs/heads/master | /config/routes.rb | Rails.application.routes.draw do
get 'home/index'
get 'home/confirm', to: "home#confirm"
get 'home/submit', to: "home#submit"
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
|
jbaquerot/Python-For-Data-Science | refs/heads/master | /ipython_log.py | # IPython log file
import json
path = 'ch02/usagov_bitly_data2012-03-16-1331923249.txt'
records = [json.loads(line) for line in open(path)]
import json
path = 'ch2/usagov_bitly_data2012-03-16-1331923249.txt'
records = [json.loads(line) for line in open(path)]
import json
path = 'ch2/usagov_bitly_data2012-11-13-13528... |
didoogan/ncube_test_front | refs/heads/master | /src/containers/Profiles/Profiles.js | import React, { Component } from 'react';
import axios from 'axios';
import ProfileItem from '../../components/ProfileItem/ProfileItem';
import Table from 'react-bootstrap/lib/Table';
import Aux from '../../hoc/Aux';
class Profiles extends Component {
state = {
profiles: null,
profilesLoaded: false
}
com... |
didoogan/ncube_test_front | refs/heads/master | /src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import axios from 'axios';
import presets from './helper/presets'
axios.defaults.baseURL = presets.SERVER_URL + '/api';
axios.interceptors.request.us... |
didoogan/ncube_test_front | refs/heads/master | /src/components/Auth/IsAuth.js | import React from 'react';
import { withRouter } from 'react-router';
export default function isAuth (Component) {
class AuthenticatedComponent extends React.Component {
render() {
return !!localStorage.getItem('token')
? <Component { ...this.props } />
: null;
}
}
return withRo... |
didoogan/ncube_test_front | refs/heads/master | /src/App.js | import React, { Component } from 'react';
import './App.css';
import Menu from './components/Menu/Menu';
import Profiles from './containers/Profiles/Profiles';
import Profile from './containers/Profile/Profile'
import Switch from 'react-router-dom/es/Switch';
import Route from 'react-router-dom/es/Route';
import Browse... |
didoogan/ncube_test_front | refs/heads/master | /src/containers/Login/Login.js | import React, { Component } from 'react'
import FormGroup from 'react-bootstrap/es/FormGroup';
import ControlLabel from 'react-bootstrap/es/ControlLabel';
import FormControl from 'react-bootstrap/es/FormControl';
import Button from 'react-bootstrap/es/Button';
import Col from 'react-bootstrap/es/Col';
import Form from ... |
didoogan/ncube_test_front | refs/heads/master | /src/components/ProfileItem/ProfileItem.js | import React from 'react'
import Button from 'react-bootstrap/es/Button'
import NavLink from 'react-router-dom/NavLink';
import Aux from '../../hoc/Aux';
const profileListItem = (props) => (
<Aux>
<tbody>
<tr>
<td>
<NavLink to={{pathname: `/profile/${props.id}`}}>{props.name}</N... |
dotnet-school/dotnet-signalr | refs/heads/master | /StreamWebServiceTest/SinglarRTest.cs | using System;
using System.Threading.Channels;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR.Client;
using Xunit;
namespace StreamWebServiceTest
{
public class UnitTest1
{
[Fact]
public async Task TestClient()
{
var url = "http://localhost:5000/subscribe/infoprice"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.