This file contains hidden or 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
| var elements; | |
| elements = document.getElementsByClassName("container-fluid container-limited limit-container-width") | |
| for (i = 0; i< elements.length; i++) { | |
| var x = elements[i]; | |
| x.setAttribute("style", "max-width:100%"); | |
| } | |
| elements = document.getElementsByClassName("container-limited limit-container-width") | |
| for (i = 0; i< elements.length; i++) { | |
| var x = elements[i]; |
This file contains hidden or 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
| /* | |
| Open "files" from top right button, then open chrome console and paste the code below | |
| it will try to delete 18 files in a row, asking for your permission every time | |
| */ | |
| for (i=1; i< 19; i++) { | |
| var a = document.querySelector('#files_tab > div > div.p-file_list > div:nth-child(1) > div > div.c-virtual_list.c-virtual_list--scrollbar.c-scrollbar > div.c-scrollbar__hider > div > div > div:nth-child(' + i + ') > div > div.c-file__actions > span> button') | |
| a.click() |
This file contains hidden or 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
| """ | |
| note while mapping https://myinfo-api.app.gov.sg/dev/tutorial3 from node into python | |
| """ | |
| import os | |
| import base64 | |
| from cryptography import exceptions | |
| from cryptography.hazmat.backends import default_backend | |
| from cryptography.hazmat.primitives import serialization, hashes | |
| from cryptography.hazmat.primitives.asymmetric import padding |
This file contains hidden or 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
| import boto3 | |
| access_key = '123' | |
| secret_key = '234' | |
| bucket_name = 'bucket' | |
| client =boto3.client( | |
| 's3', | |
| aws_access_key_id=access_key, | |
| aws_secret_access_key=secret_key, | |
| ) |
This file contains hidden or 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
| const WIDTH = '400px'; | |
| const HEIGHT = '100px'; | |
| var lists = document.getElementsByClassName('list-wrapper'); | |
| var kslist, card; | |
| for( i=0; i < lists.length; i++) { | |
| kslist = lists[i]; | |
| kslist.setAttribute('style', 'width: ' + WIDTH); | |
| var cards = kslist.getElementsByClassName('list-card'); |
This file contains hidden or 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
| var a = document.getElementsByClassName('yddiv'); | |
| for(i=0; i<9; i++){ | |
| a[i].setAttribute('style', 'height:0'); | |
| } | |
| document.getElementById('xuanfu_news_id').setAttribute('style', 'height:0'); |
This file contains hidden or 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
| // use developer console, paster these code and run, you will have a small new window which is minimized | |
| // and ready to be put to "always on top" | |
| (function() { | |
| var href=document.location.href; | |
| var newWindow = window.open(href, "myWindowName", "resizable"); | |
| newWindow.resizeTo(445,255); //resize window to 445x255 | |
| newWindow.onload = function () { | |
| var newDocument = newWindow.document; | |
| try { | |
| var content = newDocument.getElementById('content'); |
This file contains hidden or 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
| # activate virtualenvwrapper | |
| export WORKON_HOME=~/Envs | |
| mkdir -p $WORKON_HOME | |
| source /usr/local/bin/virtualenvwrapper.sh | |
| # git promt | |
| # source: https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' |