Skip to content

Instantly share code, notes, and snippets.

View waskito's full-sized avatar
🏠
Working from home

Yanuar Waskito waskito

🏠
Working from home
  • Indonesia
View GitHub Profile
@hubgit
hubgit / SelectField.tsx
Last active December 29, 2023 03:41
Use react-select with Formik
import { FieldProps } from 'formik'
import React from 'react'
import Select, { Option, ReactSelectProps } from 'react-select'
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({
options,
field,
form,
}) => (
<Select
@itod
itod / split_keyboards.md
Last active April 24, 2024 16:06
Every "split" mechanical keyboard currently being sold that I know of
var page = require('webpage').create(),
system = require('system'),
loc, address;
if (system.args.length < 3) {
console.log('Usage: screenshot.js <some URL> <some LOCATION>');
phantom.exit();
}
//viewportSize being the actual size of the headless browser
@staltz
staltz / introrx.md
Last active April 24, 2024 18:10
The introduction to Reactive Programming you've been missing
@bjinwright
bjinwright / .config
Created May 10, 2013 15:17
AWS Elastic Beanstalk container commands for installing mod_pagespeed. This example uses a Django application but just strip out commands 1 and 2 and it usable by any application. This is the follow up to the https://gist.github.com/bjinwright/5554958 Gist that shows how to setup the Apache conf file that makes this work.
container_commands:
01_collectstatic:
command: "django-admin.py collectstatic --noinput"
02_lesscss:
command: "lesscpy -x static/css/base.less > static/css/base.css"
03_setup_apache:
command: "cp enable_mod_pagespeed.conf /etc/httpd/conf.d"
04_rm_pagespeed:
command: "rm -rf /pagespeed/ebextensions"
05_mkdir_pagespeed:
@bjinwright
bjinwright / enable_mod_pagespeed.conf
Created May 10, 2013 15:01
Example mod_pagespeed conf for AWS Elastic Beanstalk.
# mod_deflate configuration
<IfModule mod_deflate.c>
# Restrict compression to these MIME types
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xml+rss
AddOutputFilterByType DEFLATE application/x-javascript
@gdamjan
gdamjan / README.md
Last active April 16, 2024 04:57
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@walterrenner
walterrenner / web-app.html
Created November 30, 2012 10:05 — forked from tfausak/ios-8-web-app.html
iOS web app - icons, startup images, install hints
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> <!-- values: default, black, black-translucent -->
<meta name="viewport" content="initial-scale=1.0">
<meta name="viewport" content="maximum-scale=1.0">
<meta name="viewport" content="user-scalable=no">
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"