Skip to content

Instantly share code, notes, and snippets.

Kowloon walled city (coin) kwccoin

View GitHub Profile
@kwccoin
kwccoin / match.c
Created Aug 2, 2020 — forked from ianmackinnon/match.c
C Regex multiple matches and groups example
View match.c
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>
@kwccoin
kwccoin / ebert_amazon.py
Created Jun 11, 2020 — forked from linstantnoodles/ebert_amazon.py
Get amazon prime information on Roger Ebert Great Movies
View ebert_amazon.py
import requests
import csv
import os
import json
import re
from bs4 import BeautifulSoup
import mechanize
from random import choice
user_agents = ['Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Debian/1.6-7','Konqueror/3.0-rc4; (Konqueror/3.0-rc4; i686 Linux;;datecode)','Opera/9.52 (X11; Linux i686; U; en)']
random_user_agent = choice(user_agents)
View Python Wake on LAN
#!/usr/bin/python
# A Wake on LAN program that allows you to send magic packets over the Internet
import socket, struct
class Waker():
def makeMagicPacket(self, macAddress):
# Take the entered MAC address and format it to be sent via socket
splitMac = str.split(macAddress,':')
# Pack together the sections of the MAC address as binary hex
@kwccoin
kwccoin / .env.sample
Created Dec 20, 2019 — forked from manrajgrover/.env.sample
Quick Docker Environment for TensorFlowJS Node
View .env.sample
root=/path/to/root
project=/path/to/project
View Cards.py
# Card Game
#
# In this game, you have to find matching pairs of cards.
# This scene consists entirely of layers and demonstrates some
# interesting animation techniques.
from scene import *
from random import shuffle
from functools import partial
import sound
@kwccoin
kwccoin / air_hockey.py
Created Jul 31, 2019 — forked from gillibrand/air_hockey.py
An Air Hockey game for Pythonista on iPad and iPhone. Yes, I typed this all on my iPad. A little painful.
View air_hockey.py
# Hockey
#
# A air hockey game for two players. First to
# seven wins.
# Most of the game is drawn with the scene
# module. Goal and winner messages are animated
# with layers.
from scene import *
from sound import *
View gist:8309db2b79c3691b32f7250eb2b7e483
/** @jsx React.DOM */
var GameStatus = {
NOTSTARTED: 0,
FINISHED: 1,
INPROGRESS: 2
}
var Suits = ['H', 'D', 'C', 'S'];
var Cards = [];
View fraud-testing.clj
(defn f-beta
"F-beta score, default uses F1"
([precision recall] (f-beta precision recall 1))
([precision recall beta]
(let [beta-squared (* beta beta)]
(* (+ 1 beta-squared)
(try ;; catch divide by 0 errors
(/ (* precision recall)
(+ (* beta-squared precision) recall))
(catch ArithmeticException e
View Visual Studio Code(VS Code)用 WordStarライクなKeyboard Shortcuts
// Place your key bindings in this file to overwrite the defaults
// https://code.visualstudio.com/docs/customization/keybindings
[
//---- 他の方のを流用 ----
// http://tonbi.jp/Web/Diary/030/
// ↑up
{ "key": "ctrl+e", "command": "cursorUp",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+e", "command": "cursorUpSelect",
"when": "editorTextFocus" },
You can’t perform that action at this time.