Skip to content

Instantly share code, notes, and snippets.

@gaearon
gaearon / index.html
Last active February 13, 2024 09:46
Multiple React components on a single HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@JoeX2
JoeX2 / snx_install.sh
Created May 26, 2017 07:09 — forked from lolotux/snx_install.sh
Checkpoint SNX VPN client installation shell script
# To have script anywhere, anytime, ever, everybody
mkdir temp && cd temp
# for linux 'amd64' architecture install those packages:
sudo apt-get install libx11-6:i386 libpam0g:i386 libstdc++5:i386 lib32z1 lib32ncurses5
wget https://vpnportal.aktifbank.com.tr/SNX/INSTALL/snx_install.sh
sudo sh snx_install.sh
@mankind
mankind / rails-jsonb-queries
Last active May 23, 2024 06:47
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 22, 2024 02:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@RickCarlino
RickCarlino / classifier.rb
Created April 5, 2015 03:21
Using the Ruby 'classifier' gem to categorize a quote as "Ben Franklin" or "Paris Hilton"
require 'classifier'
robot_overlord = Classifier::Bayes.new 'hilton', 'franklin'
robot_overlord.train_hilton("The only rule is don't be boring and dress cute wherever you go. Life is too short to blend in.")
robot_overlord.train_hilton("The way I see it, you should live everyday like its your birthday.")
robot_overlord.train_hilton("No matter what a woman looks like, if she's confident, she's sexy.")
robot_overlord.train_hilton("I'd imagine my wedding as a fairy tale... huge, beautiful and white.")
robot_overlord.train_hilton("There's nobody in the world like me. I think every decade has an iconic blonde, like Marilyn Monroe or Princess Diana and, right now, I'm that icon.")
robot_overlord.train_hilton("Some girls are just born with glitter in their veins.")
@dennysfredericci
dennysfredericci / machine_learning.rb
Created July 21, 2014 20:11
Machine Learning example using libsvm
#gem install rb-libsvm
require 'libsvm'
class Predictor
def initialize
parameter = Libsvm::SvmParameter.new
parameter.cache_size = 3 # in megabytes
@nilbus
nilbus / java_for_rubyists.md
Last active January 25, 2023 18:49
Some Java basics for Rubyists
  1. Java uses static, declared typing:

    String hello = "Hello, World!";
    List<String> phrases = new ArrayList<String>;
    phrases.add(hello);
    phrases.add(null);
    phrases.add(123); // Compile error! Not a string.
@daniambrosio
daniambrosio / devise.pt-BR.yml
Last active October 2, 2016 01:06
pt-BR-Translation-for-Devise-3.2.2
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
# Este arquivo deve ser colocado em config/locales/devise.pt-BR.yml
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso."
send_instructions: "Você receberá um email para confirmar sua conta em alguns minutis."
send_paranoid_instructions: "Caso seu endereço de email já exista em nossa base, você receberá um email com instruções sobre como ativar sua conta."
failure:
#encoding: utf-8
module M3nd3s
def me_ajuda!
"NÃO"
end
end
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.