Skip to content

Instantly share code, notes, and snippets.

View hangingman's full-sized avatar
🦙

hangedman hangingman

🦙
  • Kanagawa, Japan
  • 10:54 (UTC +09:00)
View GitHub Profile
@jacky860226
jacky860226 / Doubling Search.cpp
Created August 7, 2016 03:44
LCA Doubling Search
#define MAXN 100000
#define MAX_LOG 17
typedef vector<int >::iterator VIT;
int pa[MAX_LOG+1][MAXN+5],dep[MAXN+5];
vector<int >G[MAXN+5];
void dfs(int x,int p){
pa[0][x]=p;
for(int i=0;i+1<MAX_LOG;++i){
pa[i+1][x]=pa[i][pa[i][x]];
}
@Edenhofer
Edenhofer / fix_compilation_errors_encountered_with_kernel_4.6.patch
Created July 26, 2016 13:26
mt7610u_sta-dkms-git: Fix compilation errors encountered with kernel 4.6
From 9738b5ebd677ec5fff3be4ba83e76488b66f076b Mon Sep 17 00:00:00 2001
From: Gordian Edenhofer <[email protected]>
Date: Tue, 26 Jul 2016 15:05:18 +0200
Subject: [PATCH] Fix compilation errors encountered with kernel 4.6
Inspired by Rene Ploetz's <[email protected]> patch for chenhaiq's repository.
Signed-off-by: Gordian Edenhofer <[email protected]>
---
chips/mt76x0.c | 2 +-
@matzipan
matzipan / cheatsheet.md
Last active November 1, 2023 22:55
Vala, GLib and GTK+ cheatsheet

Building with debug symbols with cmake

cmake -DCMAKE_BUILD_TYPE=Debug .. should do the trick of building the binaries and including the debug symbols.

Enable debug messages

Set the following environment variable G_MESSAGES_DEBUG=all. This will allow you to see messages you print with debug in Vala.

GtkApplication lifecycle

@projectweekend
projectweekend / lambda_boto3_example.py
Last active February 8, 2022 13:03
Update AWS Lambda code with Boto3
import io
import os
from zipfile import ZipFile
from boto3.session import Session
session = Session(
aws_access_key_id='your-aws-access-key',
aws_secret_access_key='your-iam-secret-key',
region_name='your-aws-region')
@kenkoooo
kenkoooo / api_document.md
Last active March 7, 2021 17:33
AtCoder 非公式 API ドキュメント
@ktat
ktat / Install.pm
Last active November 10, 2017 05:26 — forked from ctyo/Install.pm
FreeStyleWiki上でMarkdown記法での記入を可能にするプラグイン
############################################################
#
# FreeStyleWiki上でMarkdown記法での記入を可能にします。
#
############################################################
package plugin::markdown::Install;
use strict;
sub install {
my $wiki = shift;
@M1nified
M1nified / document.execCommand('copy')
Last active May 8, 2022 05:24
Simple example of document.execCommand('copy')
This is an example of document.execCommand('copy')
Working copy available at https://jsfiddle.net/M1nified/Lv8qz9j9
@nashirox
nashirox / rails-validates.rb
Last active January 29, 2025 11:07
Rubyのバリデーション用正規表現集
#
# 数字
#
# 全て数値(全角)
/\A[0-9]+\z/
# 全て数値(半角)
/\A[0-9]+\z/
@cmkoller
cmkoller / sinatra-flash.md
Last active July 25, 2021 07:34
Setting up Sinatra Flash

Setting Up Sinatra Flash

Sinatra Flash is an awesome gem that allows you to pop up little messages alerting your users of important things, via some simple code in your server.rb file. This is very useful for things like displaying error messages if the user has filled out a form wrong, or displaying "success" messages if the user did something successfully like sign in, sign out, or submit a form.

This also gives you a great chance to implement Foundation's beautiful alerts. Here's how to set it up!

  1. Install the gem by typing gem install sinatra-flash in your terminal.
  2. Require the gem in the top of your server.rb file: require 'sinatra/flash'
{"110000": "w", "110001": "x", "110101": "1", "110100": "0", "010100": "U", "010101": "V", "001100": "M", "001101": "N", "011110": "e", "011111": "f", "001001": "J", "001000": "I", "011011": "b", "011010": "a", "000110": "G", "000111": "H", "000011": "D", "000010": "C", "100100": "k", "100101": "l", "111100": "8", "111101": "9", "100010": "i", "100011": "j", "101110": "u", "101111": "v", "111001": "5", "111000": "4", "101011": "r", "101010": "q", "110011": "z", "110010": "y", "010010": "S", "010011": "T", "010111": "X", "010110": "W", "110110": "2", "110111": "3", "011000": "Y", "011001": "Z", "001111": "P", "001110": "O", "011101": "d", "011100": "c", "001010": "K", "001011": "L", "101101": "t", "000000": "A", "000001": "B", "100111": "n", "100110": "m", "000101": "F", "000100": "E", "111111": "/", "111110": "+", "100001": "h", "100000": "g", "010001": "R", "010000": "Q", "101100": "s", "111010": "6", "111011": "7", "101000": "o", "101001": "p"}