This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you want to install gems locally , without having to use sudo | |
uhc:blazer-dev zatef$ bundle install --path vendor/bundle | |
# when push rails app to a brand new ubuntu machine, I came across multiple bugs and had to fix them with the below: | |
# even though we have 2.3, we still need the dev version. | |
sudo apt-get install ruby2.3-dev | |
sudo apt-get install build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@dev-instance ~]# adduser zee | |
[root@dev-instance ~]# su - zee | |
[sudo] password for zee: | |
[root@dev-instance ~]# passwd zee | |
Changing password for user zee. | |
New password: | |
Retype new password: | |
passwd: all authentication tokens updated successfully. | |
[root@dev-instance ~]# vim /etc/passwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find the diff between two tables. | |
( SELECT * FROM table1 | |
EXCEPT | |
SELECT * FROM table2) | |
UNION ALL | |
( SELECT * FROM table2 | |
EXCEPT | |
SELECT * FROM table1) | |
===== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:%s/<Ctrl-V><Ctrl-M>//g | |
find spaces before end of line and remove it ..anything before this "$" | |
:%s/\s\+$//g | |
#ctrlP plugin | |
:h ctrlp-mapping | |
#repeat a char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var submitted = false; | |
function submit(){ | |
if(submitted) { | |
alert('Obrigado por cadastrar seu e-mail!'); | |
document.getElementById('entry_0').value = ''; | |
} | |
</script> | |
<iframe name="hidden_iframe" id="hidden_iframe" style="display: none;" onload="submit();"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Your dynamic content | |
var catImage = "http://n-z.tv/wp-content/uploads/2017/08/cat-1024x683.jpg"; | |
var message = "Hey this is some dynamic content"; | |
var title = "Some Dynamic Content" | |
//Create the string and insert it into the body (or the "template" for you) | |
document.body.innerHTML = ` | |
<div> | |
<h3>${title}</h3> | |
<img src="${catImage}"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat $_ | |
# This file is auto-generated from the current state of the database. Instead | |
# of editing this file, please use the migrations feature of Active Record to | |
# incrementally modify your database, and then regenerate this schema definition. | |
# | |
# Note that this schema.rb definition is the authoritative source for your | |
# database schema. If you need to create the application database on another | |
# system, you should be using db:schema:load, not running all the migrations | |
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | |
# you'll amass, the slower it'll run and the greater likelihood for issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byte[] IFD_Address_tmp = Arrays.copyOfRange(bytes, 4, 8); | |
int IFD_Address = 0; | |
int i = 0; | |
int shiftBy = 0; | |
for (shiftBy = 0; shiftBy < 32; shiftBy += 8) { | |
IFD_Address |= ((long) (IFD_Address_tmp[i] & 0xff)) << shiftBy; | |
i++; | |
} | |
OlderNewer