Skip to content

Instantly share code, notes, and snippets.

View hopewise's full-sized avatar

Samir Sabri hopewise

View GitHub Profile
@joshuap
joshuap / rails_lamby_notes.md
Last active February 21, 2022 09:00
Deploy a new Rails app to AWS Lambda using Lamby
1) locate your jdk bin folder:
`/usr/libexec/java_home`
2) navigate to your jdk bin folder
`cd /usr/libexec/java_home`
3) to generate a signing key
`sudo keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000`
-- will ask you to add password and information
@ck3g
ck3g / example.ex
Created February 14, 2019 16:14
How to read from STDIN in Elixir (for HackerRank)
defmodule Solution do
#Enter your code here. Read input from STDIN. Print output to STDOUT
end
array_length = IO.read(:stdio, :line)
array = IO.read(:stdio, :line)
array_length
|> String.trim
|> String.to_integer
@mrgnw
mrgnw / README.md
Last active May 28, 2021 19:00
iTerm2 scripts #config #macOS

iTerm2 Scripts

Docs

iTerm loads .scpt AppleScript files from:

~/Library/Application Support/iTerm2/Scripts
files: # this is set up for where to create the new file from the .ebextensions during environment setup
"/etc/nginx/conf.d/01_webapp.conf":
mode: "000644"
owner: root
group: root
content: | # Copy the contents of your original /etc/nginx/conf.d/webapp.conf file below.
# Comments are provided where changes or additions are required
upstream app_name { # the name can be anything other than my_app, which is used in the default webapp.conf file
server unix:///var/run/puma/my_app.sock;
}
@davidleandro
davidleandro / list_tables.rb
Last active February 23, 2023 08:52
Rails list all tables count
tables = []
ActiveRecord::Base.connection.tables.each do |t|
count = ActiveRecord::Base.connection.exec_query("select count(*) from #{t}").rows[0][0]
tables << [t, count.to_i]
end
tables.sort_by { |t| t[1] }.reverse!

error info:

➜  hh (develop-hh) ✔ gem install libv8 -v '3.16.14.11'
Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
	ERROR: Failed to build gem native extension.

    current directory: /Users/simonqian/.rvm/gems/ruby-2.2.2/gems/libv8-3.16.14.11/ext/libv8
/Users/simonqian/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20170410-48026-19k49a7.rb extconf.rb
creating Makefile
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active June 28, 2024 20:49
React Native Bridging Cheatsheet
@renganatha10
renganatha10 / NativeManager.java
Created February 22, 2017 17:54
Set of Example for Bridging android native Modules in React Native
package com.musicapp;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@bnhansn
bnhansn / readme.md
Last active August 8, 2023 05:53
Ubuntu Elixir Distillery Deployment

Rough outline of setting up a Ubuntu server for deploying an Elixir app with Distillery.

ssh into server

ssh root@ip.address

update packages