Skip to content

Instantly share code, notes, and snippets.

@memezilla
memezilla / canada_states_titlecase.json
Created January 11, 2021 02:57 — forked from pbojinov/canada_states_titlecase.json
US states & Canadian Provinces in JSON form
[
{
"name": "Alberta",
"abbreviation": "AB"
},
{
"name": "British Columbia",
"abbreviation": "BC"
},
{
@memezilla
memezilla / Shadowsocks_With_V2Ray.md
Created June 22, 2019 08:33
Install Shadowsocks With V2Ray Manually

Installing Packages

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install build-essential haveged linux-headers-$(uname -r) cron screen shadowsocks-libev -y && apt-get clean -y && apt-get autoremove -y

Install V2Ray

cd /etc/shadowsocks-libev/
https://github.com/shadowsocks/v2ray-plugin/releases
dpkg --print-architecture
wget file_for_system
@memezilla
memezilla / TP_Mac_Setup.markdown
Created February 19, 2019 03:44 — forked from nvgrw/TP_Mac_Setup.markdown
TurboPascal setup tutorial for Mac

TurboPascal on Mac

Note: probably 99% of this tutorial (excluding installation and folder structure) is DOSBox- and not Mac-specific. As long as your computer can run DOSBox you should be able to convert the steps to work on Windows.

1. Downloading & Installing DOSBox

DOS apps don't run natively on OS X, so we use DOSBox to emulate DOS for us.

1a. Downloading DOSBox

Navigate to the official DOSBox download page

@memezilla
memezilla / media-query.css
Created December 24, 2018 06:09 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@memezilla
memezilla / LinearGraph.jsx
Created July 31, 2018 09:31 — forked from isaaguilar/LinearGraph.jsx
Draw a basic scatter plot graph with react and d3. Draw the trend-line between your points. Example graph in comments below.
import React from "react"
import ScatterPlot from "./ScatterPlot-with-trendline"
data={[[0, 3],[5, 13],[10, 22],[15, 36],[20, 48],[25, 59],[30, 77],[35, 85],[40, 95],[45, 105],[50, 120],[55, 150],[60, 147],[65, 168],[70, 176],[75, 188],[80, 199],[85, 213],[90, 222],[95, 236],[100, 249]]}
export default class LinearGraph extends React.Component {
render() {
return <ScatterPlot data={data} />
}
}
@memezilla
memezilla / README.md
Created May 19, 2018 09:17 — forked from tommct/README.md
Instructions for downloading Jupyter Notebooks from Coursera

From an open Jupyter Notebook homework assignment, select "Coursera" to take you to the home page. Make a new notebook and fill it with the following and excute the cell with:

%%bash
tar cvfz hw.tar.gz .

This may take a little while to run depending on the packages. Select "Coursera" again to take you to the Home directory. Check the hw.tar.gz file and then Download. After the file is downloaded, delete it.

@memezilla
memezilla / client.js
Created April 26, 2018 01:45 — forked from RashadSaleh/client.js
deepstream with GraphQL subscriptions and permissioning
// SYNTACTIC SUGAR ON TOP OF deepstream CLIENT API
var deepstream = require('deepstream.io-client-js');
String.prototype.hash = function() {
var hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
import React from 'react'
import hoistNonReactStatics from 'hoist-non-react-statics'
import { assoc, assocPath, identity, is, map, prop } from 'ramda'
import isValid from './isValid'
// random helper function
// extract the needed information from the event
const getValueName = (e) => {
const target = e.target
const name = target.name
import React from 'react'
const enhancedForm = Component =>
class HigherOrderComponent extends React.Component {
constructor(props) {
super(props)
this.state = { form: props.initialState }
this.handleSubmit = this.handleSubmit.bind(this)
this.handleChange = this.handleChange.bind(this)
@memezilla
memezilla / destructuring.js
Created May 18, 2017 06:49 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];