Skip to content

Instantly share code, notes, and snippets.

Avatar

Ken Takagiwa giwa

View GitHub Profile
@staltz
staltz / introrx.md
Last active Aug 7, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@demisx
demisx / angularjs-providers-explained.md
Last active Aug 7, 2020
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
View angularjs-providers-explained.md
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@fernandoaleman
fernandoaleman / Linux Static IP
Created Mar 23, 2012
How To Configure Static IP On CentOS 6
View Linux Static IP
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@brandonb927
brandonb927 / LICENSE.md
Last active Aug 3, 2020 — forked from myfreeweb/LICENSE.md
Use Markdown in Evernote with Marked.app
View LICENSE.md
       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
               Version 2, December 2004

Copyright (C) 2012 Brandon B. brandon@brandonbrown.io

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@taichi
taichi / code_reading.md
Last active Aug 2, 2020
太一のコードの読み方メモ
View code_reading.md

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
@jfarmer
jfarmer / 01-truthy-and-falsey-ruby.md
Last active Aug 2, 2020
True and False vs. "Truthy" and "Falsey" (or "Falsy") in Ruby, Python, and JavaScript
View 01-truthy-and-falsey-ruby.md

true and false vs. "truthy" and "falsey" (or "falsy") in Ruby, Python, and JavaScript

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).

This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.

If you want to use or share this material, please see the license file, below.

Update

@joshlk
joshlk / faster_toPandas.py
Last active Jul 31, 2020
PySpark faster toPandas using mapPartitions
View faster_toPandas.py
import pandas as pd
def _map_to_pandas(rdds):
""" Needs to be here due to pickling issues """
return [pd.DataFrame(list(rdds))]
def toPandas(df, n_partitions=None):
"""
Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is
repartitioned if `n_partitions` is passed.
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created Jan 19, 2016
how to access subdomains locally with Rails 5
View subdomain-localhost-rails-5.md

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@enjalot
enjalot / index.html
Created Sep 8, 2011
Simple Pie Chart example with D3.js
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
View beautiful_idiomatic_python.md

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

You can’t perform that action at this time.