Skip to content

Instantly share code, notes, and snippets.

View thangngoc89's full-sized avatar

Khoa Nguyen thangngoc89

View GitHub Profile
@alopresto
alopresto / gpg_git_signing.md
Last active January 18, 2024 22:42
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@MoOx
MoOx / webpack.config.babel.js
Last active March 28, 2016 06:20
Simpler webpack config concept
import webpackSimpleConfig from "webpack-simple-config"
/*
ideas:
- simpler config
- fix loaders order (imo, more logical order): proof is that every new webpack user don't get this part
- no tons of way to provide config via string, query etc
- some shortcuts: simple extract, aliases
*/
#!/bin/bash -e
# option parsing.
FAST_ESLINT=0
ALLOW_WARNINGS=0
ESLINT_VERBOSE=0
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts ":fvw" opt; do
case "$opt" in
v) ESLINT_VERBOSE=1
@jakub-g
jakub-g / hn.md
Last active January 19, 2023 04:21
Hacker News Links

Hacker News "hidden" URLs

Many of HN URLs are not easily discoverable as there are no links to them in a prominent part on the page, or sometimes even nowhere. The following is a list of links to standard and "special" HN pages. The ones is bold are the less discoverable ones.

See also: https://github.com/minimaxir/hacker-news-undocumented

Posts

var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
@ryanmcgrath
ryanmcgrath / example.js
Last active January 23, 2021 09:42
A basic React Video tag. I wanted to use video.js inside something I was building, so this is more or less a 5-minute tag for handling it. ES6 syntax but you can extrapolate what you need. Handles dynamically loading video.js/css as necessary since I really loathe serving any swf/etc myself. Could be easily extended or made better, works for me …
import React from 'react';
import Video from './Video';
class MyGenericApp extends React.Component {
render() {
return <div>
<Video src="my_video_url" poster="my_poster_url" />
</div>;
}
}
@chapel
chapel / About.md
Last active October 15, 2016 15:15
Discourse topic list customizations for http://discourse.wastingyourlife.co
@coderberry
coderberry / MaskedTextField.jsx
Last active May 27, 2017 18:18
MaskedTextField with material-ui
/** @jsx React.DOM */
var React = require('react')
, mui = require('material-ui')
, { TextField } = mui
, $ = require('jquery');
require('jquery.inputmask');
var MaskedTextField = React.createClass({
@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live